package com.ruoyi.system.api.factory;

import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.system.api.RemoteDeptService;
import com.ruoyi.system.api.RemoteDictService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author nansonghao
 * @description dict
 * @date 2022/7/20
 * @LastUpdate
 */
@Component
public class RemoteDictFallbackFactory implements FallbackFactory<RemoteDictService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteDictFallbackFactory.class);

    @Override
    public RemoteDictService create(Throwable cause) {
        log.error("日志服务调用失败:{}", cause.getMessage());
        return new RemoteDictService() {

            @Override
            public String getDictLabel(JSONObject inParam) {
                return null;
            }

            @Override
            public String getDictValue(JSONObject inParam) {
                return null;
            }
        };
    }
}
